    const webpackMerge = require('webpack-merge');
    const webpack = require('webpack');
    const ExtractTextPlugin = require('extract-text-webpack-plugin');
    const HtmlWebpackPlugin = require('html-webpack-plugin');
    const baseConfig = require('./config/base');
    const config = require('./config/config');
    const ip = require('ip').address();
    const path = require('path');
    console.log(ip);
    const defPath = config.defPath;

    // 使用 `webpack-merge` 将基础配置和新配置合并
    module.exports = webpackMerge(baseConfig(), {
        devtool: 'source-map',
        entry:defPath.ENTRY_PATH,
        output: {   // 出口
            path: defPath.DEV_PATH,     // 所有输出文件的目标路径
            // 所有输出文件的目标路径
            filename: 'js/[name].js',   // 输出文件命名
            publicPath: '/',
            library:'bee',
            libraryTarget:'umd'
        },
        module: {
            rules: [
                {
                    test: /\.jsx?$/,
                    exclude: /node_modules/,
                    loader: 'babel-loader',
                    options: {
                      cacheDirectory: true,
                      presets: ['env', 'stage-2', 'react'],
                      plugins: ['transform-runtime'],
                    },
                },
                {
                    test: /\.(css|less)$/,
                    use: ExtractTextPlugin.extract({
                        fallback:"style-loader",
                        use:['css-loader?sourceMap', `less-loader?import=${[path.resolve(__dirname, './src/style.less')]}` ]
                    })
                },
                {
                    test: /\.module$/i,
                    use: ExtractTextPlugin.extract({
                        fallback:"style-loader",
                        use:['css-loader?modules&localIdentName=[name]__[local]-[hash:base64:5]', 'less-loader' ]
                    })
                },

                {
                    test: /\.(eot|woff|woff2|ttf|svg|png|jpe?g|gif|mp4|webm)(\?\S*)?$/,
                    include: defPath.APP_PATH,
                    loader: 'url-loader?limit=10000&name=images/[name].[ext]'
                },
            ]
        },
        plugins: [
            // 定义环境变量
            new webpack.DefinePlugin({
                'process.env.NODE_ENV': JSON.stringify('development')
            }),
            new ExtractTextPlugin('css/styles.css'),
            new HtmlWebpackPlugin({
                template: defPath.TPL_PATH,
                publicPath: '/',
                filename: 'index.html',
                inject: 'body',
                minify: {
                  removeComments: true
                },
                cache: false
              })
        ],
        devServer: {
            // contentBase: path.resolve(__dirname,'./build'),
            clientLogLevel: 'none',
            host: '0.0.0.0',
            port: 9100,
            // quiet: true,
            inline: true,
            open:true
        }
    });